/*
 * XML Type:  ConnectionVisualModel
 * Namespace: http:///org/isistan/flabot/edit/editormodel.ecore
 * Java type: org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.edit.editormodelEcore.impl;
/**
 * An XML ConnectionVisualModel(@http:///org/isistan/flabot/edit/editormodel.ecore).
 *
 * This is a complex type.
 */
public class ConnectionVisualModelImpl extends org.isistan.flabot.edit.editormodelEcore.impl.NodeVisualModelImpl implements org.isistan.flabot.edit.editormodelEcore.ConnectionVisualModel
{
    private static final long serialVersionUID = 1L;
    
    public ConnectionVisualModelImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName BENDPOINTS$0 = 
        new javax.xml.namespace.QName("", "bendpoints");
    private static final javax.xml.namespace.QName SOURCE$2 = 
        new javax.xml.namespace.QName("", "source");
    private static final javax.xml.namespace.QName TARGET$4 = 
        new javax.xml.namespace.QName("", "target");
    private static final javax.xml.namespace.QName SOURCETERMINAL$6 = 
        new javax.xml.namespace.QName("", "sourceTerminal");
    private static final javax.xml.namespace.QName TARGETTERMINAL$8 = 
        new javax.xml.namespace.QName("", "targetTerminal");
    private static final javax.xml.namespace.QName TARGET2$10 = 
        new javax.xml.namespace.QName("", "target");
    private static final javax.xml.namespace.QName SOURCE2$12 = 
        new javax.xml.namespace.QName("", "source");
    
    
    /**
     * Gets array of all "bendpoints" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint[] getBendpointsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(BENDPOINTS$0, targetList);
            org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint[] result = new org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "bendpoints" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint getBendpointsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint)get_store().find_element_user(BENDPOINTS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "bendpoints" element
     */
    public int sizeOfBendpointsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BENDPOINTS$0);
        }
    }
    
    /**
     * Sets array of all "bendpoints" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setBendpointsArray(org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint[] bendpointsArray)
    {
        check_orphaned();
        arraySetterHelper(bendpointsArray, BENDPOINTS$0);
    }
    
    /**
     * Sets ith "bendpoints" element
     */
    public void setBendpointsArray(int i, org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint bendpoints)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint)get_store().find_element_user(BENDPOINTS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(bendpoints);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "bendpoints" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint insertNewBendpoints(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint)get_store().insert_element_user(BENDPOINTS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "bendpoints" element
     */
    public org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint addNewBendpoints()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.ConnectionBendpoint)get_store().add_element_user(BENDPOINTS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "bendpoints" element
     */
    public void removeBendpoints(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BENDPOINTS$0, i);
        }
    }
    
    /**
     * Gets array of all "source" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[] getSourceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(SOURCE2$12, targetList);
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[] result = new org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "source" element
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel getSourceArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().find_element_user(SOURCE2$12, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "source" element
     */
    public int sizeOfSourceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SOURCE2$12);
        }
    }
    
    /**
     * Sets array of all "source" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setSourceArray(org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[] sourceArray)
    {
        check_orphaned();
        arraySetterHelper(sourceArray, SOURCE2$12);
    }
    
    /**
     * Sets ith "source" element
     */
    public void setSourceArray(int i, org.isistan.flabot.edit.editormodelEcore.NodeVisualModel source)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().find_element_user(SOURCE2$12, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(source);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "source" element
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel insertNewSource(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().insert_element_user(SOURCE2$12, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "source" element
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel addNewSource()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().add_element_user(SOURCE2$12);
            return target;
        }
    }
    
    /**
     * Removes the ith "source" element
     */
    public void removeSource(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SOURCE2$12, i);
        }
    }
    
    /**
     * Gets array of all "target" elements
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[] getTargetArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(TARGET2$10, targetList);
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[] result = new org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "target" element
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel getTargetArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().find_element_user(TARGET2$10, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "target" element
     */
    public int sizeOfTargetArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TARGET2$10);
        }
    }
    
    /**
     * Sets array of all "target" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setTargetArray(org.isistan.flabot.edit.editormodelEcore.NodeVisualModel[] targetValueArray)
    {
        check_orphaned();
        arraySetterHelper(targetValueArray, TARGET2$10);
    }
    
    /**
     * Sets ith "target" element
     */
    public void setTargetArray(int i, org.isistan.flabot.edit.editormodelEcore.NodeVisualModel targetValue)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().find_element_user(TARGET2$10, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(targetValue);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "target" element
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel insertNewTarget(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().insert_element_user(TARGET2$10, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "target" element
     */
    public org.isistan.flabot.edit.editormodelEcore.NodeVisualModel addNewTarget()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.edit.editormodelEcore.NodeVisualModel target = null;
            target = (org.isistan.flabot.edit.editormodelEcore.NodeVisualModel)get_store().add_element_user(TARGET2$10);
            return target;
        }
    }
    
    /**
     * Removes the ith "target" element
     */
    public void removeTarget(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TARGET2$10, i);
        }
    }
    
    /**
     * Gets the "sourceTerminal" attribute
     */
    public java.lang.String getSourceTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SOURCETERMINAL$6);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "sourceTerminal" attribute
     */
    public org.apache.xmlbeans.XmlString xgetSourceTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(SOURCETERMINAL$6);
            return target;
        }
    }
    
    /**
     * True if has "sourceTerminal" attribute
     */
    public boolean isSetSourceTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(SOURCETERMINAL$6) != null;
        }
    }
    
    /**
     * Sets the "sourceTerminal" attribute
     */
    public void setSourceTerminal(java.lang.String sourceTerminal)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SOURCETERMINAL$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SOURCETERMINAL$6);
            }
            target.setStringValue(sourceTerminal);
        }
    }
    
    /**
     * Sets (as xml) the "sourceTerminal" attribute
     */
    public void xsetSourceTerminal(org.apache.xmlbeans.XmlString sourceTerminal)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(SOURCETERMINAL$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(SOURCETERMINAL$6);
            }
            target.set(sourceTerminal);
        }
    }
    
    /**
     * Unsets the "sourceTerminal" attribute
     */
    public void unsetSourceTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(SOURCETERMINAL$6);
        }
    }
    
    /**
     * Gets the "targetTerminal" attribute
     */
    public java.lang.String getTargetTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TARGETTERMINAL$8);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "targetTerminal" attribute
     */
    public org.apache.xmlbeans.XmlString xgetTargetTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TARGETTERMINAL$8);
            return target;
        }
    }
    
    /**
     * True if has "targetTerminal" attribute
     */
    public boolean isSetTargetTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(TARGETTERMINAL$8) != null;
        }
    }
    
    /**
     * Sets the "targetTerminal" attribute
     */
    public void setTargetTerminal(java.lang.String targetTerminal)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TARGETTERMINAL$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TARGETTERMINAL$8);
            }
            target.setStringValue(targetTerminal);
        }
    }
    
    /**
     * Sets (as xml) the "targetTerminal" attribute
     */
    public void xsetTargetTerminal(org.apache.xmlbeans.XmlString targetTerminal)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TARGETTERMINAL$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(TARGETTERMINAL$8);
            }
            target.set(targetTerminal);
        }
    }
    
    /**
     * Unsets the "targetTerminal" attribute
     */
    public void unsetTargetTerminal()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(TARGETTERMINAL$8);
        }
    }
    
    /**
     * Gets the "target" attribute
     */
    public java.lang.String getTarget2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TARGET2$10);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "target" attribute
     */
    public org.apache.xmlbeans.XmlString xgetTarget2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TARGET2$10);
            return target;
        }
    }
    
    /**
     * True if has "target" attribute
     */
    public boolean isSetTarget2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(TARGET2$10) != null;
        }
    }
    
    /**
     * Sets the "target" attribute
     */
    public void setTarget2(java.lang.String target2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TARGET2$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(TARGET2$10);
            }
            target.setStringValue(target2);
        }
    }
    
    /**
     * Sets (as xml) the "target" attribute
     */
    public void xsetTarget2(org.apache.xmlbeans.XmlString target2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(TARGET2$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(TARGET2$10);
            }
            target.set(target2);
        }
    }
    
    /**
     * Unsets the "target" attribute
     */
    public void unsetTarget2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(TARGET2$10);
        }
    }
    
    /**
     * Gets the "source" attribute
     */
    public java.lang.String getSource2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SOURCE2$12);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "source" attribute
     */
    public org.apache.xmlbeans.XmlString xgetSource2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(SOURCE2$12);
            return target;
        }
    }
    
    /**
     * True if has "source" attribute
     */
    public boolean isSetSource2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(SOURCE2$12) != null;
        }
    }
    
    /**
     * Sets the "source" attribute
     */
    public void setSource2(java.lang.String source2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SOURCE2$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SOURCE2$12);
            }
            target.setStringValue(source2);
        }
    }
    
    /**
     * Sets (as xml) the "source" attribute
     */
    public void xsetSource2(org.apache.xmlbeans.XmlString source2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(SOURCE2$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(SOURCE2$12);
            }
            target.set(source2);
        }
    }
    
    /**
     * Unsets the "source" attribute
     */
    public void unsetSource2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(SOURCE2$12);
        }
    }
}
